<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Coole PHP 微框架</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="description" content="Coole 是一个基于开源组件包组建的 PHP 微框架"/>
    <meta name="keywords" content="Coole,PHP,php,php 框架,php 微框架,框架,微框架,组建框架,构建框架,搭建框架"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"/>
    <link rel="shortcut icon" href="./static/favicon.png"/>
    <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/vue.css"/>
    <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.css"/>
    <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk/dist/gitalk.css"/>
    <style>
        .app-name-link img {
            width: 38%;
        }
    </style>
</head>

<body>
<div id="app"></div>
<div id="google_translate_element" style="position: absolute;top: 26px;right: 80px;z-index: 9999;opacity: 1;"></div>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-php.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-edit-on-github/index.js"></script>
<script src="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>
  mermaid.initialize({startOnLoad: false});

  window.$docsify = {
    name: 'Coole PHP 微框架',
    repo: 'guanguans/coole',
    homepage: './前言/项目介绍.md',
    loadSidebar: 'summary.md',
    loadNavbar: true,
    fallbackLanguages: [],
    coverpage: true,
    mergeNavbar: true,
    themeColor: '#4948cc',
    logo: './static/logo.png',
    auto2top: true,
    subMaxLevel: 4,
    topMargin: 20,
    search: {
      maxAge: 86400000,
      depth: 6,
      noData: {
        '/': '没有找到结果!'
      },
      paths: 'auto',
      placeholder: {
        '/': '输入关键词搜索'
      },
      namespace: 'coole',
      pathNamespaces: ['/']
    },
    alias: {},
    plugins: [
      EditOnGithubPlugin.create('https://github.com/guanguans/coole/blob/main/docs/')
    ],
    plantuml: {
      skin: 'classic',
    },
    pagination: {
      previousText: '上一篇',
      nextText: '下一篇',
      crossChapter: true,
      crossChapterText: false,
    },
    markdown: {
      renderer: {
        code: function (code, lang) {
          if (lang === "mermaid") {
            return ('<div class="mermaid">' + mermaid.render(lang, code) + '</div>');
          }
          return this.origin.code.apply(this, arguments);
        }
      }
    }
  }
</script>
<script src="//cdn.jsdelivr.net/npm/docsify-copy-code"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-plantuml/dist/docsify-plantuml.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/zoom-image.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-pagination/dist/docsify-pagination.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/gitalk.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.js"></script>
<script id="translate_google_js" src="https://translate.google.cn/translate_a/element.js?cb=googleTranslateElementInit"></script>
<script>
  // 百度统计
  var _hmt = _hmt || [];
  (function() {
    var hm = document.createElement("script");
    hm.src = "//hm.baidu.com/hm.js?3f7bb74ce14bd9aa75a947a99ea63f3c";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
  })();

  // google analytics
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', '257572807', 'auto');
  ga('send', 'pageview');

  // gitalk
  var pathNames = decodeURI(window.location.href).split('#/');
  var pathName = pathNames && pathNames[1] ? pathNames[1] : '/'
  console.log(pathNames);
  const gitalk = new Gitalk({
    clientID: 'c3750903c5d7743a0a4f',
    clientSecret: 'cab251713be26605a9993107b4ae9384ffa7ad14',
    repo: 'docs',
    owner: 'coolephp',
    admin: ['guanguans'],
    distractionFreeMode: false,
    id: pathName.split('?')[0],
    language: 'zh-CN',
  })

  // 谷歌翻译
  function googleTranslateElementInit() {
    var google_translate_element = document.getElementById('google_translate_element');
    var timer = setInterval(function () {
      google_translate_element = document.getElementById('google_translate_element');
      if (google_translate_element) {
        clearInterval(timer);
        var langName = navigator.language ? navigator.language.split('-')[0].toLowerCase() : 'en';
        new google.translate.TranslateElement({
              pageLanguage: langName,
              //0，原生select，并且谷歌logo显示在按钮下方。1，原生select，并且谷歌logo显示在右侧。2，完全展开语言列表，适合pc，
              layout: /mobile/i.test(navigator.userAgent) ? 0 : 0,
            },
            'google_translate_element'
        );
      }
    }, 300);
  }
</script>
</body>

</html>